
package me.zhengjie.repository;

import me.zhengjie.domain.AppWorkConfig;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.sql.Timestamp;

/**
* @website https://el-admin.vip
* @author IQW
* @date 2022-07-13
**/
public interface AppWorkConfigRepository extends JpaRepository<AppWorkConfig, Integer>, JpaSpecificationExecutor<AppWorkConfig> {

    @Modifying
    @Query(value = "update app_work_config set status = 0 where status = 1 and end_time < ?1 ",nativeQuery = true)
    void setWorkConfigExp(Timestamp now);
}